﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;
using Cosmetic.DataAccess;
using Cosmetic.DataEntity;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace Cosmetic.Logic
{
    public class DiscountCardManger : LogicBase
    {
        private DiscountCard  m_DiscountCard = new DiscountCard ();
        /// <summary>
        /// 新增一个卡号
        /// </summary>
        /// <param name="anumber">The product want delete</param>

        public void Insert(DiscountCard  anumber)
        {
            m_CosmeticDC.DiscountCards .InsertOnSubmit(anumber);
            m_CosmeticDC.SubmitChanges();
        }

        /// <summary>
        /// 删除一个卡号
        /// </summary>
        /// <param name="aProduct">The product want delete</param>
        public void Delete(DiscountCard  anumber)
        {
            m_CosmeticDC.DiscountCards.DeleteOnSubmit(anumber);
            m_CosmeticDC.SubmitChanges();
        }
        /// <summary>
        /// 查询所有的卡号
        /// </summary>
        /// <param name="anumber">The product want delete</param>

        public List<DiscountCard> GetAll()
        {
            return (from theActivity in m_CosmeticDC.DiscountCards
                    select theActivity).ToList();
        }

    }
}
